﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class PlayerData : MonoBehaviour
{
    //public PlayerMovement pm;

    public float originalSpeed;
    public float originalJumpForce;
    public float originalHangingJumpForce;
    public int originalMaxJumpTimes;

    private float speed;
    private float jumpForce;
    private float hangingJumpForce;
    private int maxJumpTimes;

    // Start is called before the first frame update
    void Start()
    {
        InitializeData();
    }

    private void InitializeData()
    {

        speed = originalSpeed;
        jumpForce = originalJumpForce;
        hangingJumpForce = originalHangingJumpForce;
        maxJumpTimes = originalMaxJumpTimes;
    }

    public void MultiplySpeedByRatio(float ratio)
    {
        speed *= ratio;
    }
    public void MultiplyJumpForceByRatio(float ratio)
    {
        jumpForce *= ratio;
    }
    public void MultiplyHangingJumpForceByRatio(float ratio)
    {
        hangingJumpForce *= ratio;
    }

    public void AddConstantToMaxJumpTime(int constant)
    {
        maxJumpTimes += constant;
    }

    public float GetSpeed()
    {
        return speed;
    }

    public float GetJumpForce()
    {
        return jumpForce;
    }
    public float GetHangingJumpForce()
    {
        return hangingJumpForce;
    }
    public int GetMaxJumpTimes()
    {
        return maxJumpTimes;
    }
}
